<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="com.shengl.app.util.Translation" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>m_updateMusic</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<SCRIPT language=javascript>
<!--
function reg_Validator(f) {
	if (window.RegExp) {
	  var reg = new RegExp("[^ ]+","gi");
	  if (!reg.test(f.elements[0].value)) {
	    alert("歌名不能为空，如果您不知道，可写“未知”");
	    f.elements[0].focus();
	    return(false);
	  }
	 }
	 
	if (window.RegExp) {
	  var reg = new RegExp("[^ ]+","gi");
	  if (!reg.test(f.elements[1].value) || f.elements[1].value=="http://") {
	    alert("音乐地址不能为空！");
	    f.elements[1].focus();
	    return(false);
	  }
	}
	
	
	BadStr = new Array(".mp3",".wma",".MP3",".WMA", ".Mp3", ".Wma", ",", "，", "。", "-", "—", "_", ">", "<", "｀", "《", "》","`", "]", "[", "！", "？","『", "』", "!","】", "【", "●", "＂");
	var SongName = document.all("songName").value;
	var Singer = document.all("singerName").value;
	for(i=0;i<BadStr.length;i++)
	{
		if(SongName.indexOf(BadStr[i])>=0)
		{
			alert("歌曲名称请尽量规范，不能包含特殊字符 \""+BadStr[i]+"\"");
			f.elements[0].focus();
			return(false);
		}
	}
	
	for(i=0;i<BadStr.length;i++)
	{
		if(Singer.indexOf(BadStr[i])>=0)
		{
			alert("歌手名称请尽量规范，不能包含特殊字符 \""+BadStr[i]+"\"");
			document.all("singerName").focus();
			return(false);
		}
	}
}
//-->
</SCRIPT>
  </head>
  
  <body>
  	<h2>${success }</h2>
  	<FORM onsubmit="return reg_Validator(this)" action="m_updateMusicOk.html" method="post">
  	必填项<FONT color=red>*</FONT> 　<B>注意：为了方便他人查找，请您尽可能填写标准的 歌曲名 和 歌手，不要夹杂其他词语或符号</B> 
	<DIV class=must_item>
		<P class=asform>歌名：　　 <INPUT size=25 name=songName value=${music.songName }> </P>
		<P class=asform>音乐地址： <INPUT size=55 name=songPath value=${music.songPath }> (mp3, wma格式) </P>
	</DIV>
	选填项 
  	<input type="hidden" name="musicId" value="${music.musicId }">
	<DIV class=need_item>
	<P class=asform>歌手：　　 <INPUT size=25 name=singerName value=${music.singerName }> 请规范填写</P>
	<P class=asform>语言：　　 <c:forEach items="<%=Translation.songLanguageList()%>" var="LabelValue">
							 <INPUT type=radio value=${LabelValue.value } name=songLanguage <c:if test="${music.songLanguage == LabelValue.value}">checked=checked</c:if>>${LabelValue.label }
							 </c:forEach></P>
	<P class=asform>歌词：　　 <TEXTAREA name=lyric rows=6 cols=55>${music.lyric }</TEXTAREA> </P>
	<P class=asform>标签：　　 <INPUT size=55 name=label value=${music.label }> <BR>为该歌曲添加标签，多个标签之间用<SPAN class=black>逗号</SPAN>间隔 </P>
	<P class=asform>推荐感言： <TEXTAREA name=note rows=6 cols=55>${music.note }</TEXTAREA> 
	<TABLE>
		<TBODY>
			<TR>
			<TD width=60>歌曲类型： </TD>
			<TD>
				<UL class=add_songcatlist>
					<c:forEach items="<%=Translation.songTypeList()%>" var="LabelValue">
			        <LI><INPUT type=checkbox value=${LabelValue.value } name=songType[] <c:forEach items="${Types }" var="type"><c:if test="${type == LabelValue.value}">checked=checked</c:if></c:forEach>>${LabelValue.label } </LI>
			        </c:forEach>
		        </UL>
	        </TD>
			</TR>
		</TBODY>
	</TABLE>
	<P style="MARGIN-LEFT: 150px"><INPUT type=submit value=" 提交推荐 "> </P>
	</DIV>
</FORM>
    <h2><a href="m_musicList.html"><span>返回歌曲列表</span></a></h2>
  </body>
</html>
